

<template>
  <div>
    <div class="flex-input">
      <div>
        <el-input v-model="getListParme.name"   placeholder="姓名" />
      </div>
      <div>
        <el-input v-model="getListParme.workUnit"  placeholder="工作单位" />
      </div>
      <div>
        <el-select
            v-model="getListParme.eduDegreeList"
            multiple
            collapse-tags
            filterable
            collapse-tags-tooltip
            placeholder="最后学位"
            style="width: 100%"
            @focus="zuihouxueweiOptions"
        >
          <el-option
              v-for="item in zuihouxueweiOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
      </div>
      <div>
        <el-select
            v-model="getListParme.titleIdList"
            multiple
            collapse-tags
            filterable
            collapse-tags-tooltip
            placeholder="职称"
            style="width: 100%"
            @focus="getzhichengOptions"
        >
          <el-option
              v-for="item in zhichengOptions"
              :key="item.codeColumn"
              :label="item.valueColumn"
              :value="item.codeColumn"
          />
        </el-select>
      </div>
      <div>
        <el-select
            v-model="getListParme.expertSource"
            clearable
            placeholder="专家来源"
            style="width: 100%"
            @focus="getzhichengOptions"
        >
          <el-option
              v-for="item in zhuanjialaiyuanOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
      </div>
      <div style="min-width: 180px">
        <el-button icon="ArrowLeft"  @click="searchOpen = !searchOpen">更多</el-button>
<!--        <el-button icon="ArrowLeft" @click="drawer = true">更多</el-button>-->
        <el-button type="primary" icon="Search" @click ="searchBtnList">查询</el-button>
      </div>

    </div>
    <div  v-show="searchOpen" class="sss">
      <el-input
          v-model="getListParme.account"
          placeholder="职工号"
      />
      <el-input
          v-model="getListParme.mobile"
          placeholder="手机号"
      />
      <el-input
          v-model="getListParme.telOffice"
          placeholder="办公电话"
      />
      <el-input
          v-model="getListParme.researchField"
          placeholder="研究方向"
      />
      <el-select
          v-model="getListParme.sexId"
          clearable
          placeholder="性别"
      >
        <el-option
            v-for="item in sex"
            :key="item.value"
            :label="item.label"
            :value="item.value"
        />
      </el-select>
      <el-select
          v-model="getListParme.subjectIdList"
          multiple
          collapse-tags
          filterable
          collapse-tags-tooltip
          placeholder="一级学科"
          @focus="getyijixuekeOptions"
      >
        <el-option
            v-for="item in yijixuekeOptions"
            :key="item.id"
            :label="item.label"
            :value="item.id"
        />
      </el-select>
      <el-select
          v-model="getListParme.eduLevelList"
          multiple
          collapse-tags
          filterable
          collapse-tags-tooltip
          placeholder="最后学历"
      >
        <el-option
            v-for="item in zuihouxueliOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
        />
      </el-select>
      <el-select
          v-model="getListParme.honorTitleIdList"
          multiple
          collapse-tags
          filterable
          collapse-tags-tooltip
          placeholder="荣誉称号"
      >
        <el-option
            v-for="item in rongyuchenghaoOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
        />
      </el-select>

    </div>
    <div>
      <el-table
          border
          ref="multipleTableRef"
          :data="tableData"
          default-expand-all
          style="width: 100%"
          @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" />
        <el-table-column  label="姓名">
          <template #default="scope">
            <div style="cursor: pointer;color: #2A91FE">
              <span @click="openpeopledetails(scope.row)">{{ scope.row.name }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column property="workUnit" label="工作单位" />
<!--        <el-table-column property="eduDegree" label="最后学位" />-->
        <el-table-column label="最后学位">
          <template #default="{ row }">
            {{ getDegreeName(row.eduDegree) }}
          </template>
        </el-table-column>
        <el-table-column property="subjectName" label="一级学科" />
        <el-table-column property="titleName" label="职称 "/>
        <el-table-column  label="专家来源">
        <template #default="scope">
          <div>
            <span v-if="scope.row.expertSource ==1">校内</span>
            <span v-if="scope.row.expertSource ==0">校外</span>
          </div>
        </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" min-width="120">
          <template #default="scope">
            <el-button link type="primary" size="small"   @click="handleClick(scope.row)">
              编辑
            </el-button>
            <el-button link type="primary" size="small"  @click="TableDelete(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <div class="example-pagination-block">
      <el-pagination
          layout="->,prev, pager, next, total"
          :total="count"
          currentPage1="10"
          @current-change="handleCurrentChange"
      />
    </div>
  </div>

  <!--  更多-->
  <el-drawer v-model="drawer" :direction="direction">
    <template #header>
      <h4>选择条件</h4>
    </template>
    <template #default>
      <div class="sss">
        <el-input
            v-model="getListParme.account"
            style="width: 200px"
            placeholder="职工号"
        />
        <el-input
            v-model="getListParme.mobile"
            style="width: 200px"
            placeholder="手机号"
        />
        <el-input
            v-model="getListParme.telOffice"
            style="width: 200px"
            placeholder="办公电话"
        />
        <el-input
            v-model="getListParme.researchField"
            style="width: 200px"
            placeholder="研究方向"
        />
        <el-select
            v-model="getListParme.sexId"
            clearable
            placeholder="性别"
            style="width: 200px"
        >
          <el-option
              v-for="item in sex"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
        <el-select
            v-model="getListParme.subjectIdList"
            multiple
            collapse-tags
            filterable
            collapse-tags-tooltip
            placeholder="一级学科"
            style="width: 100%"
            @focus="getyijixuekeOptions"
        >
          <el-option
              v-for="item in zuihouxueweiOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
        <el-select
            v-model="getListParme.eduLevelList"
            multiple
            collapse-tags
            filterable
            collapse-tags-tooltip
            placeholder="最后学历"
            style="width: 100%"
        >
          <el-option
              v-for="item in zuihouxueliOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>
        <el-select
            v-model="getListParme.honorTitleIdList"
            multiple
            collapse-tags
            filterable
            collapse-tags-tooltip
            placeholder="荣誉称号"
            style="width: 100%"
        >
          <el-option
              v-for="item in rongyuchenghaoOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
          />
        </el-select>

      </div>
    </template>
    <template #footer>
      <div style="flex: auto">
        <el-button @click="cancelClick">关闭</el-button>
        <el-button type="primary" @click="searchBtnList">查询</el-button>
      </div>
    </template>
  </el-drawer>
  <!--  更多-->
  <!--  编辑-->
  <el-dialog v-model="dialogFormVisible" title="编辑专家" width="70%">
    <el-form
        ref="ruleFormRef"
        :model="ruleForm"
        :rules="rules"

        class="demo-ruleForm"
        :size="formSize"
        status-icon
    >
      <div class="dialog-flex">
        <div>
          <el-form-item label-width="120px" label="姓名" prop="name" >
            <el-input v-model="ruleForm.name" />
          </el-form-item>

          <el-form-item label-width="120px" label="职称" prop="titleId">
            <el-select @focus="getzhichengOptions" value-key="value" v-model="ruleForm.titleId" placeholder="请选择职称">
              <el-option
                  v-for="item in zhichengOptions"
                  :key="item.codeColumn"
                  :label="item.valueColumn"
                  :value="item.codeColumn"

              />
            </el-select>
          </el-form-item>
          <el-form-item label-width="120px" label="工作单位" prop="workUnit">
            <el-input v-model="ruleForm.workUnit" autocomplete="off" />
          </el-form-item>
          <el-form-item label-width="120px" label="统计归属" prop="subjectClassId">
            <el-radio-group v-model="ruleForm.subjectClassId" @change="GetsubjectClassId">
              <el-radio label="科技类" value="2"/>
              <el-radio label="社科类" value="1"/>
            </el-radio-group>
          </el-form-item>
          <el-form-item label-width="120px" label="一级学科" prop="subjectId">
            <el-select
                v-model="ruleForm.subjectId"
                placeholder="请选择一级学科"
                @focus="getyijixuekeOptions"
            >
              <el-option
                  v-for="item in yijixuekeOptions"
                  :key="item.id"
                  :label="item.label"
                  :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label-width="120px" label="出生年月"  prop="birthday">
            <el-date-picker
                v-model="ruleForm.birthday"
                type="date"
                format="YYYY/MM/DD"
                value-format="YYYY-MM-DD"
                aria-label="选择时间"
                placeholder="选择时间"
            />
          </el-form-item>
          <el-form-item label-width="120px" label="手机号" prop="mobile">
            <el-input v-model="ruleForm.mobile" autocomplete="off" />
          </el-form-item>
          <el-form-item label-width="120px" label="办公电话" prop="telOffice" >
            <el-input v-model="ruleForm.telOffice" autocomplete="off" />
          </el-form-item>
          <el-form-item label-width="120px" label="电子邮件" prop="email">
            <el-input v-model="ruleForm.email" autocomplete="off" />
          </el-form-item>

        </div>
        <div>
          <el-form-item label-width="120px" label="性别" prop="sexId">
            <el-radio-group v-model="ruleForm.sexId">
              <el-radio label="男" value="1"/>
              <el-radio label="女" value="0"/>
            </el-radio-group>
          </el-form-item>
          <el-form-item label-width="120px" label="最后学位" prop="eduDegree">
            <el-radio-group v-model="ruleForm.eduDegree">
              <el-radio label="博士" value="2"/>
              <el-radio label="硕士" value="3"/>
              <el-radio label="学士" value="4"/>
              <el-radio label="无" value="999"/>
            </el-radio-group>
          </el-form-item>
          <el-form-item label-width="120px" label="最后学历" prop="eduLevel">
            <el-radio-group v-model="ruleForm.eduLevel">
              <el-radio label="博士研究生" value="0"/>
              <el-radio label="硕士研究生" value="1"/>
              <el-radio label="本科" value="2"/>
              <el-radio label="大专" value="3"/>
              <el-radio label="中专" value="4"/>
              <el-radio label="其他" value="5"/>
            </el-radio-group>
          </el-form-item>
          <el-form-item label-width="120px" label="荣誉称号">
            <el-checkbox-group v-model="ruleForm.honorTitleId">
              <el-checkbox label="院士" value="1" name="type" />
              <el-checkbox label="突出青年" value="2" name="type" />
              <el-checkbox label="长江学者" value="3" name="type" />
              <el-checkbox label="其他" value="4" name="type" />
            </el-checkbox-group>
          </el-form-item>



        </div>
      </div>
      <div>
        <el-form-item label-width="120px" label="研究方向">
          <el-input v-model="ruleForm.researchField" type="textarea" />
        </el-form-item>

      </div>
      <div style="display:flex;">
        <el-form-item style="margin: auto">
          <el-button  type="primary" @click="submitForm(ruleFormRef)">
<!--            编辑专家-->
            保存
          </el-button>
<!--          <el-button style="text-align: center" @click="resetForm(ruleFormRef)">重置</el-button>-->
          <el-button  type="primary" @click="dialogFormVisible = false">
            <!--            编辑专家-->
            关闭
          </el-button>
        </el-form-item>
      </div>

    </el-form>
  </el-dialog>
  <!--  编辑-->


  <zjrcpeopleDetails :activ="activ"  :obj="obj"  @close-dialog="activ = false"></zjrcpeopleDetails>
</template>
<script lang="ts" setup>
const searchOpen = ref(false)
import zjrcpeopleDetails from './../../../components/peopleDetails/zjrcpeopleDetails.vue'
import {getCategory} from "@/api/researcherNavApi/researcherNavApi"
import {
  exportList,
  selectExpertList,
  selectExpertDetails,
  deletExpert,
  updateExpertList
} from "@/api/researcherNavApi/zjrcApi"
import {DrawerProps, ElMessage, ElMessageBox} from "element-plus";
import {onMounted, reactive, ref} from "vue";
const drawer = ref(false) //更多在弹出
const direction = ref<DrawerProps['direction']>('rtl')
const radio1 = ref('Option 1')

//导出
import {handleFileDownload} from './../../../utils/downloadSz'
const Export = () => {
  // 复制一份 getListParme 对象， 避免修改原始数据
  //const requestData = { ...getListParme.value };
  exportList({   ...getListParme.value}

  )
      .then((res)=>{
        if (res.code === 500) {
          ElMessage({
            type: 'error',
            message: '数据库查询出错，请联系管理员检查 SQL 语句。'
          });
        } else if (!(res instanceof Blob)) {
          ElMessage({
            type: 'info',
            message: '响应数据不是 Blob 类型'
          });
        } else {
          handleFileDownload(res, '专家人才');
        }
      })
}
const getDegreeName = (degreeId) => {
  if (degreeId === undefined || degreeId == null) {
    return '未知';
  }
  const degreeMap = {
    2: '博士',
    3: '硕士',
    4: '学士',
    999: '无'
  };
  return degreeMap[degreeId] || '未知';
};
//分页
const count = ref(0)
const handleCurrentChange = (val: string) => {
  getListParme.value.page = val
  selectExpertList(getListParme.value)
      .then((res)=>{
        tableData.value = res.data.list
        count.value = res.data.count
      })
  console.log(`current page: ${val}`)
}
//打开详情
const openpeopledetails = function (row){
  activ.value = true
  console.log(activ.value)
  obj.value = row.id
}
const activ = ref(false)
const obj = ref('')

//打开详情end
onMounted(() => {
  searchBtnList()
});
//查询
const searchBtnList =function () {
  console.log(getListParme.value)
  selectExpertList(getListParme.value)
      .then((res)=>{
        tableData.value = res.data.list
        count.value = res.data.count
      })
}
//查询end

const getListParme = ref({
  checkstatus: "",//（全部传空，通过传2，退回传4，待审核传0）
  name:'', //姓名
  workUnit:'', //工作单位
  eduDegreeList:[], //最后学位
  eduLevelList:[], //最后学历
  titleIdList:[], //职称
  expertSource:'', //专家来源职称
  account:'', //职工号
  subjectIdList:[], //一级学科
  sexId:'', //性别 0女  1男
  honorTitleIdList:[], //荣誉称号
  mobile:'', //手机
  telOffice:'', //办公电话
  researchField:'', //研究方向
  page:'1',
  pageSize:'10'
})
//荣誉称号
const rongyuchenghaoOptions= [
  {
    value: '院士',
    label: '院士',
  },
  {
    value: '突出青年',
    label: '突出青年',
  },
  {
    value: '长江学者',
    label: '长江学者',
  },
  {
    value: '其他',
    label: '其他',
  },
]
//最后学位
const zuihouxueweiOptions = [
  {
    value: '2',
    label: '博士',
  },
  {
    value: '3',
    label: '硕士',
  },
  {
    value: '4',
    label: '学士',
  },
  {
    value: '999',
    label: '无',
  },
]
//最后学历
const zuihouxueliOptions = [
  {
    value: '0',
    label: '博士研究生',
  },
  {
    value: '1',
    label: '硕士研究生',
  },
  {
    value: '2',
    label: '本科',
  },
  {
    value: '3',
    label: '大专',
  },
  {
    value: '4',
    label: '中专',
  },
  {
    value: '5',
    label: '其他',
  },
]
//男女
const sex = [
  {
    value: '1',
    label: '男',
  },
  {
    value: '0',
    label: '女',
  },
]
//职称
const zhichengOptions = ref([])
//获取职称下拉
const getzhichengOptions =function () {
  //职称
  getCategory(
      {
        'bizName':'职称单选'
      }
  )
      .then((res)=>{

        zhichengOptions.value = res.data
      })
}
//专家来源
const zhuanjialaiyuanOptions = [
  {
    value: '1',
    label: '校内',
  },
  {
    value: '0',
    label: '校外',
  },
]
const  GetsubjectClassId = function (){
  ruleForm.subjectId = ''
}
//一级学科
const yijixuekeOptions = ref([])
const getyijixuekeOptions =function () {
  getCategory(
      {
        'bizName':'一级学科',
        valueCascade: ruleForm.subjectClassId
      }
  )
      .then((res)=>{

        yijixuekeOptions.value = res.data
      })
}

//所属单位
const suoshudanweiOptions = ref([])
const getsuoshudanweiOptions =function () {
  getCategory(
      {
        'bizName':'成果归属单位'
      }
  )
      .then((res)=>{

        suoshudanweiOptions.value = res.data
      })
}

//批量删除
const multipleSelection = ref([])
const handleSelectionChange = (val) => {

  multipleSelection.value = val
  console.log(val,'console.log(handleSelectionChange)')
}
const open = () => {
  if(multipleSelection.value.length < 1){
    ElMessage({
      type: 'warning',
      message: '请选择想要删除的数据',
    })
  }else {
    ElMessageBox.confirm(
        '确认！删除这条数据?',
        '提醒',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        }
    )
        .then(() => {
          let deleteArr = []
          for (let i = 0; i < multipleSelection.value.length; i++) {
            deleteArr.push(multipleSelection.value[i].id)
          }
          deletExpert({'idList':deleteArr})
              .then((res)=>{
                if(res.code==200){
                  ElMessage({
                    type: 'success',
                    message: res.data,
                  })
                  searchBtnList()
                }else {
                  ElMessage({
                    type: 'info',
                    message: res.msg,
                  })
                }
              })
        })
        .catch(() => {
          // ElMessage({
          //   type: 'info',
          //   message: 'Delete canceled',
          // })
        })
  }


}

//批量删除 end
//删除
const TableDelete = function (row) {
  ElMessageBox.confirm(
      '确认！删除这条数据?',
      '提醒',
      {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      }
  )
      .then(() => {
        let deleteArr = []
        for (let i = 0; i < multipleSelection.value.length; i++) {
          deleteArr.push(multipleSelection.value[i].id)
        }
        deletExpert({'idList':[row.id]})
            .then((res)=>{
              if(res.code==200){
                ElMessage({
                  type: 'success',
                  message: res.data,
                })
                searchBtnList()
              }else {
                ElMessage({
                  type: 'info',
                  message: res.msg,
                })
              }
            })
      })
      .catch(() => {
        // ElMessage({
        //   type: 'info',
        //   message: 'Delete canceled',
        // })
      })
}

function cancelClick() {
  drawer.value = false
}




const tableData = ref([])


// 编辑
const dialogFormVisible = ref(false)

const handleClick =function (row){
  dialogFormVisible.value = true
  getzhichengOptions()
  getyijixuekeOptions()
  getsuoshudanweiOptions()
  selectExpertDetails({id:row.id})
      .then((res)=>{
        Object.assign(ruleForm, {
          name: res.data[0].name, //人名
          titleId:res.data[0].titleId,//职称
          workUnit:res.data[0].workUnit,
          subjectId:res.data[0].subjectId,//一级学科
          birthday:res.data[0].birthday,//出生年月
          mobile:res.data[0].mobile,//手机号
          telOffice:res.data[0].telOffice,//办公电话
          email:res.data[0].email,//电子邮件
          sexId:res.data[0].sexId,//性别
          eduDegree:res.data[0].eduDegree,//最后学位
          subjectClassId:res.data[0].subjectClassId,//归属统计
          eduLevel:res.data[0].eduLevel,//最后学历
          honorTitleId:res.data[0] && res.data[0].honorTitleId
            ? res.data[0].honorTitleId.split(',')
            : [],//杰出人才
          researchField:res.data[0].researchField,//研究方向
          expertSource:row.expertSource,
          id:row.id,

          // account:res.data[0].account, //职工号
          // sexId:res.data[0].sexId,//性别
          // hrUnitId: res.data[0].hrUnitId,//人事单位
          // unitId:res.data[0].unitId,//所属单位
          // titleId:res.data[0].titleId,//职称
          // searchClassId: res.data[0].searchClassId,  //科学研究领域.
          // searchId:res.data[0].searchId,//一级学科
          // eduDegreeId:res.data[0].eduDegreeId,//最后学位
          // titleRank:res.data[0].titleRank,//最后学位
          // eduLevelId:res.data[0].eduLevelId,//最后学历
          // personState:res.data[0].personState,//在职情况
          // isStat:res.data[0].isStat,//是否统计
          // polityId:res.data[0].polityId,//政治面貌
          // honorTitleId:res.data[0].honorTitleId.split(','),//杰出人才
          // tutorTypeId:res.data[0].tutorTypeId,//硕导/博导
          // nameEn:res.data[0].nameEn,//英文名
          // email:res.data[0].email,//电子邮件
          // mobile:res.data[0].mobile,//手机号
          // telOffice:res.data[0].telOffice,//办公电话
          // birthday:res.data[0].birthday,//出生年月
          // idCard:res.data[0].idCard,//身份证号
          // graduateSchool:res.data[0].graduateSchool,//毕业院校
          // researchField:res.data[0].researchField,//研究方向
          // learnSpecialty:res.data[0].learnSpecialty,//教育经历
          // experienceAbroad: res.data[0].experienceAbroad,//出国经历
          // learning: res.data[0].learning,//进修培训情况
          // parttime: res.data[0].parttime,//学术及社会兼职
          // id:row.id
        });
      })
}

const formLabelWidth = '140px'
const formSize = ref('default')
const ruleFormRef = ref<FormInstance>()
const ruleForm = reactive<RuleForm>({
  name: 'Hello', //人名
  titleId:'',//职称
  workUnit:'',//工作单位
  subjectId:'',//一级学科
  birthday:'',//出生年月
  mobile:'',//手机号
  telOffice:'',//办公电话
  email:'',//电子邮件

  sexId:'',//性别
  eduDegree:'',//最后学位
  subjectClassId:'2',//  归属统计
  eduLevel:'',//最后学历
  honorTitleId:[],//荣誉称号
  researchField:"",//研究方向
  expertSource:'0'
})

interface RuleForm {
  name: string
  titleId: string
  workUnit: string
  subjectId: string
  birthday: string
  mobile: string
  telOffice:string//办公电话
  email: string
  sexId:string
  eduDegree: string
  subjectClassId: string
  eduLevel: string
  honorTitleId: string[]
  researchField: string
  expertSource:string
}
const rules = reactive<FormRules<RuleForm>>({

  name: [
    { required: true, message: '请填写姓名', trigger: 'blur' },
  ],
  sexId: [
    {required: true, message: '请选择性别', trigger: 'change',},
  ],
  titleId: [
    {required: true, message: '请选择职称', trigger: 'change',},
  ],
  birthday: [
    {type: 'date', required: true, message: '请选择出生年月', trigger: 'change',},
  ],
  workUnit: [
    {required: true, message: '请输入工作单位', trigger: 'blur',},
  ],
  mobile: [
    {required: true, message: '请输入手机号', trigger: 'blur',},
  ],
  email: [
    {required: true, message: '请输入电子邮件', trigger: 'blur',},
  ],
  telOffice: [
    {required: true, message: '请输入办公电话', trigger: 'blur',},
  ],
  subjectId: [
    {required: true, message: '请选择科学一级学科', trigger: 'change',},
  ],
  eduDegree:[
    {required: true, message: '请选择最后学位', trigger: 'change',},
  ],
  eduLevel:[
    {required: true, message: '请选择最后学历', trigger: 'change',},
  ],
  subjectClassId:[
    {required: true, message: '请选择统计', trigger: 'change',},
  ],
  researchField: [
    {required: true, message: '请输入研究方向', trigger: 'blur',},
  ],


})

const submitForm = async (formEl: FormInstance | undefined) => {
  if (!formEl) return
  await formEl.validate((valid, fields) => {
    if (valid) {
      ruleForm.honorTitleId = ruleForm.honorTitleId.join(',')
      updateExpertList(ruleForm)
          .then((res)=>{
            console.log(res)
            if(res.code ==200){
              ElMessage({
                type: 'success',
                message: res.data,
              })
              searchBtnList()
              dialogFormVisible.value = false
            }else {
              ElMessage({
                type: 'info',
                message: res.msg,
              })
            }
          })
      console.log('submit!')
    } else {
      console.log('error submit!', fields)
    }
  })
}

const resetForm = (formEl: FormInstance | undefined) => {
  if (!formEl) return
  formEl.resetFields()
}
// 编辑

//接受父组件刷新列表
const fathergeilist = function (){
  selectExpertList(getListParme.value)
      .then((res)=>{
        tableData.value = res.data.list
        count.value = res.data.count
      })
}
//接受父组件刷新列表end
//公开函数
defineExpose({open,fathergeilist,Export})
</script>

<style scoped lang="scss">

.flex-input{
  display: flex;
  margin: 10px 5px 10px 0;
}
.flex-input > div{
  margin-right: 10px;
  width: 20%;
}
.sss > div{
  margin: 5px 3px;
  width: 19%;
}
.dialog-flex{
  display: flex;
}
.dialog-flex > div{
  width: 50%;
}
</style>